package com.nit.week12.repository;

import com.nit.week12.model.Book;
import org.hibernate.Session;
import org.hibernate.query.Query;

import java.util.List;

public class HibernateDemo {

    public static void main(String args[]) {
        Session s = HibernateSessionFactory.getSession();
        Query query = s.createQuery("from Book");
        List<Book> listBook = query.list();
        HibernateSessionFactory.closeSession();
        for(Book book : listBook) {
            System.out.println(book.toString());
        }
    }
}
